-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PeriodicReportingFetchV2Error to fetch metrics multiple times #40251
Add PeriodicReportingFetchV2Error to fetch metrics multiple times #40251
Conversation
CloudWatch metrics can take time to appear after a we create a brand new resource.
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
c887f60
to
5b39dc1
Compare
/test |
3 similar comments
/test |
/test |
/test |
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@@ -20,7 +21,7 @@ func TestFetch(t *testing.T) { | |||
config := mtest.GetConfigForTest(t, "sqs", "300s") | |||
|
|||
metricSet := mbtest.NewReportingMetricSetV2Error(t, config) | |||
events, errs := mbtest.ReportingFetchV2Error(metricSet) | |||
events, errs := mbtest.PeriodicReportingFetchV2Error(metricSet, 1*time.Minute, 8*time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning on replacing ReportingfetchV2Error with PeriodicReportingFetchV2Error in other metricsets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to focus this PR on removing the flakiness from the test suite so that other teams can continue with their tasks.
Do you know of other tests that need more than one call to Fetch()
to succeed due to latency or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if this solution proves effective, we can adopt it for more tests that need more than one fetch.
@zmoog should we backport this to 8.15/8.14/7.17 ? |
Good point. Let me add the labels and take care of these backports. |
…0251) * Retry fetching CloudWatch metrics a few times CloudWatch metrics can take time to appear after a we create a brand new resource. * fix wrong import * Fix events * Retry 5 times every 60s * Switch to PeriodicReportingFetchV2Error * Fix linter complaints * Remove unused code * Remove unused code * Address linter complaints * Address linter complaints * Improve function docs * Cleanup (cherry picked from commit 532133b)
…0251) * Retry fetching CloudWatch metrics a few times CloudWatch metrics can take time to appear after a we create a brand new resource. * fix wrong import * Fix events * Retry 5 times every 60s * Switch to PeriodicReportingFetchV2Error * Fix linter complaints * Remove unused code * Remove unused code * Address linter complaints * Address linter complaints * Improve function docs * Cleanup (cherry picked from commit 532133b)
…0251) * Retry fetching CloudWatch metrics a few times CloudWatch metrics can take time to appear after a we create a brand new resource. * fix wrong import * Fix events * Retry 5 times every 60s * Switch to PeriodicReportingFetchV2Error * Fix linter complaints * Remove unused code * Remove unused code * Address linter complaints * Address linter complaints * Improve function docs * Cleanup (cherry picked from commit 532133b) # Conflicts: # metricbeat/mb/testing/modules.go
…trics multiple times (#40295) * Add PeriodicReportingFetchV2Error to fetch metrics multiple times (#40251) * Retry fetching CloudWatch metrics a few times CloudWatch metrics can take time to appear after a we create a brand new resource. * fix wrong import * Fix events * Retry 5 times every 60s * Switch to PeriodicReportingFetchV2Error * Fix linter complaints * Remove unused code * Remove unused code * Address linter complaints * Address linter complaints * Improve function docs * Cleanup (cherry picked from commit 532133b) # Conflicts: # metricbeat/mb/testing/modules.go * Resolve conflicts --------- Co-authored-by: Maurizio Branca <[email protected]> Co-authored-by: Maurizio Branca <[email protected]>
…0251) (#40296) * Retry fetching CloudWatch metrics a few times CloudWatch metrics can take time to appear after a we create a brand new resource. * fix wrong import * Fix events * Retry 5 times every 60s * Switch to PeriodicReportingFetchV2Error * Fix linter complaints * Remove unused code * Remove unused code * Address linter complaints * Address linter complaints * Improve function docs * Cleanup (cherry picked from commit 532133b) Co-authored-by: Maurizio Branca <[email protected]>
Proposed commit message
Try to fetch CloudWatch metrics multiple times instead of just once.
CloudWatch metrics can take time to appear after creating a brand-new resource. So, the tests must fetch the metrics multiple times until they find the metric values or reach the time limit.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues